package com.ym.soso.domain.param;

import com.ym.common.annotations.CustomConstraint;
import com.ym.common.constant.BeanCovert;
import com.ym.base.enums.FlagEnum;
import com.ym.soso.domain.entity.AppHealthPlateEntity;
import com.ym.soso.enums.BannerShowTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import static com.ym.common.constant.ValidRule.Add;
import static com.ym.common.constant.ValidRule.Update;

/**
 * 健康科普对象 app_health_plate
 *
 * @author ym
 * @date 2020-08-24
 */
@ApiModel("健康科普-修改")
@Builder
@Data
@EqualsAndHashCode
@AllArgsConstructor
@NoArgsConstructor
public class AppHealthPlateUpdateParam extends BeanCovert<AppHealthPlateEntity> {

	@ApiModelProperty("主键")
	@NotNull(message = "主键不能为空", groups = {Add.class, Update.class})
	private Long id;

	@ApiModelProperty("父级标签")
	@Size(max = 2, message = "父级标签长度超过{max}", groups = {Add.class, Update.class})
	@NotEmpty(message = "父标签不能为空", groups = {Add.class, Update.class})
	private String parentTag;

	@ApiModelProperty("子标签")
	@NotEmpty(message = "子标签不能为空", groups = {Add.class, Update.class})
	@Size(max = 2, message = "子标签长度超过{max}", groups = {Add.class, Update.class})
	private String tag;

	@ApiModelProperty("标题")
	@NotEmpty(message = "标题不能为空", groups = {Add.class, Update.class})
	@Size(max = 200, message = "标题长度超过{max}", groups = {Add.class, Update.class})
	private String title;

	@ApiModelProperty("图片")
	@Size(max = 200, message = "图片长度超过{max}", groups = {Add.class, Update.class})
	private String bannerImg;

	@ApiModelProperty("作者")
	@Size(max = 200, message = "作者长度超过{max}", groups = {Add.class, Update.class})
	private String author;

	@ApiModelProperty("简介")
	@Size(max = 500, message = "简介长度超过{max}", groups = {Add.class, Update.class})
	private String simple;

	@ApiModelProperty("内容")
	@NotEmpty(message = "内容不能为空", groups = {Add.class, Update.class})
	private String content;

	@ApiModelProperty("点击显示类型01富文本02跳转链接")
	@NotEmpty(message = "点击显示类型不能为空", groups = {Add.class, Update.class})
	@Size(max = 2, message = "点击显示类型01富文本02跳转链接长度超过{max}", groups = {Add.class, Update.class})
	@CustomConstraint(BannerShowTypeEnum.class)
	private String showType;

	@ApiModelProperty("图片外链 00否01是")
	@NotEmpty(message = "图片外链不能为空", groups = {Add.class, Update.class})
	@Size(max = 2, message = "图片外链长度超过{max}", groups = {Add.class, Update.class})
	@CustomConstraint(FlagEnum.class)
	private String imgLink;

	@ApiModelProperty("跳转链接")
	@Size(max = 500, message = "跳转链接长度超过{max}", groups = {Add.class, Update.class})
	private String targetUrl;

	@ApiModelProperty("头像")
	@Size(max = 64, message = "头像长度超过{max}", groups = {Add.class, Update.class})
	private String headUrl;

	@ApiModelProperty("医院名称")
	@Size(max = 200, message = "医院名称长度超过{max}", groups = {Add.class, Update.class})
	private String hosName;

	@ApiModelProperty("科室名称")
	@Size(max = 200, message = "科室名称长度超过{max}", groups = {Add.class, Update.class})
	private String deptName;

	@ApiModelProperty("职称名称")
	@Size(max = 64, message = "职称名称长度超过{max}", groups = {Add.class, Update.class})
	private String jobName;

}
